home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / mmdf / libz / tzfile.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-09-10  |  2.8 KB  |  112 lines

  1. #ifndef lint
  2. #ifndef NOID
  3. static char    tzfilehid[] = "@(#)tzfile.h    3.1";
  4. #endif /* !NOID */
  5. #endif /* !lint */
  6.  
  7. /*
  8. ** Information about time zone files.
  9. */
  10.  
  11. #ifndef TZDIR
  12. #define TZDIR        "/etc/zoneinfo"    /* Time zone object file directory */
  13. #endif /* !TZDIR */
  14.  
  15. #ifndef TZDEFAULT
  16. #define TZDEFAULT    "localtime"
  17. #endif /* !TZDEFAULT */
  18.  
  19. /*
  20. ** Each file begins with. . .
  21. */
  22.  
  23. struct tzhead {
  24.     char    tzh_reserved[32];    /* reserved for future use */
  25.     char    tzh_timecnt[4];        /* coded number of transition times */
  26.     char    tzh_typecnt[4];        /* coded number of local time types */
  27.     char    tzh_charcnt[4];        /* coded number of abbr. chars */
  28. };
  29.  
  30. /*
  31. ** . . .followed by. . .
  32. **
  33. **    tzh_timecnt (char [4])s        coded transition times a la time(2)
  34. **    tzh_timecnt (unsigned char)s    types of local time starting at above
  35. **    tzh_typecnt repetitions of
  36. **        one (char [4])        coded GMT offset in seconds
  37. **        one (unsigned char)    used to set tm_isdt
  38. **        one (unsigned char)    that's an abbreviation list index
  39. **    tzh_charcnt (char)s        '\0'-terminated zone abbreviaton strings
  40. */
  41.  
  42. /*
  43. ** In the current implementation, "tzset()" refuses to deal with files that
  44. ** exceed any of the limits below.
  45. */
  46.  
  47. #ifndef TZ_MAX_TIMES
  48. /*
  49. ** The TZ_MAX_TIMES value below is enough to handle a bit more than a
  50. ** year's worth of solar time (corrected daily to the nearest second) or
  51. ** 138 years of Pacific Presidential Election time
  52. ** (where there are three time zone transitions every fourth year).
  53. */
  54. #define TZ_MAX_TIMES    370
  55. #endif /* !TZ_MAX_TIMES */
  56.  
  57. #ifndef TZ_MAX_TYPES
  58. #ifndef NOSOLAR
  59. #define TZ_MAX_TYPES    256    /* Limited by what (unsigned char)'s can hold */
  60. #else /* !NOSOLAR */
  61. #define TZ_MAX_TYPES    10    /* Maximum number of local time types */
  62. #endif /* !NOSOLAR */
  63. #endif /* !TZ_MAX_TYPES */
  64.  
  65. #ifndef TZ_MAX_CHARS
  66. #define TZ_MAX_CHARS    50    /* Maximum number of abbreviation characters */
  67. #endif /* !TZ_MAX_CHARS */
  68.  
  69. #define SECS_PER_MIN    60
  70. #define MINS_PER_HOUR    60
  71. #define HOURS_PER_DAY    24
  72. #define DAYS_PER_WEEK    7
  73. #define DAYS_PER_NYEAR    365
  74. #define DAYS_PER_LYEAR    366
  75. #define SECS_PER_HOUR    (SECS_PER_MIN * MINS_PER_HOUR)
  76. #define SECS_PER_DAY    ((long) SECS_PER_HOUR * HOURS_PER_DAY)
  77. #define MONS_PER_YEAR    12
  78.  
  79. #define TM_SUNDAY    0
  80. #define TM_MONDAY    1
  81. #define TM_TUESDAY    2
  82. #define TM_WEDNESDAY    3
  83. #define TM_THURSDAY    4
  84. #define TM_FRIDAY    5
  85. #define TM_SATURDAY    6
  86.  
  87. #define TM_JANUARY    0
  88. #define TM_FEBRUARY    1
  89. #define TM_MARCH    2
  90. #define TM_APRIL    3
  91. #define TM_MAY        4
  92. #define TM_JUNE        5
  93. #define TM_JULY        6
  94. #define TM_AUGUST    7
  95. #define TM_SEPTEMBER    8
  96. #define TM_OCTOBER    9
  97. #define TM_NOVEMBER    10
  98. #define TM_DECEMBER    11
  99. #define TM_SUNDAY    0
  100.  
  101. #define TM_YEAR_BASE    1900
  102.  
  103. #define EPOCH_YEAR    1970
  104. #define EPOCH_WDAY    TM_THURSDAY
  105.  
  106. /*
  107. ** Accurate only for the past couple of centuries;
  108. ** that will probably do.
  109. */
  110.  
  111. #define isleap(y) (((y) % 4) == 0 && ((y) % 100) != 0 || ((y) % 400) == 0)
  112.